﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="findlocationM.aspx.cs" Inherits="NegevGas.Extensions.findlocation.findlocationM" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html>

<head>
    <title>Find Address Task</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  <!--  <link rel="stylesheet" href="../../../styles/gt.css" type="text/css" />-->
      <link rel="stylesheet" href="../../styles/viewer.css" type="text/css" />
    <script type="text/javascript" language="javascript" src="js/ZoomCoord2.js"></script>
      <script type="text/javascript" language="javascript" src="../json.js"></script>
     <script type="text/javascript" language="javascript" src="../../Scripts/jquery-1.4.1.min.js"></script>
        
    <script language="javascript" type="text/javascript">
        var Ycoord;
        var Xcoord;
        var Px, Py;
     
       /* var tmID;*/


        $(document).ready(function () {
            /*  debugger;*/
            // Handler for .ready() called.


            Ycoord = $('#<%=Ycoord.ClientID%>');
            Xcoord = $('#<%=Xcoord.ClientID%>');
            InitDocument();
           


        });

        function zoomzfd() {

            var x, y;
            /*  document.getElementById("txtResX").value = "";
            document.getElementById("txtResY").value = "";*/
            if (document.getElementById("Xcoord").value != "") {
                if (isNaN(document.getElementById("Xcoord").value)) {
                    alert("X יש להזין קואורדינאטת");
                    return;
                }
                x = parseFloat(document.getElementById("Xcoord").value);
            }
            else {
                alert("X יש להזין קואורדינאטת");
                return;
            }

            if (document.getElementById("Ycoord").value != "") {
                if (isNaN(document.getElementById("Ycoord").value)) {
                    alert("Y יש להזין קואורדינאטת");
                    return;
                }
                y = parseFloat(document.getElementById("Ycoord").value);
            }
            else {
                alert("Y יש להזין קואורדינאטת");
                return;
            }

            if (document.getElementById("kanam").value != "") {
                if (isNaN(document.getElementById("kanam").value)) {
                    alert("יש להזין קנה מידה תקין");
                    return;
                }
                dblKanam = parseFloat(document.getElementById("kanam").value);
            }








        }

   
 function clearmap() {
            /*   parent.Refresh();*/
            this.location.href = "findlocationmain.aspx?SESSION=<%= mgSessionId %>&map=<%= mgMap %>";
        }

        function Clearall() {

            document.getElementById("reshet").selectedIndex = 0;
            document.getElementById("Xcoord").value = "";
            document.getElementById("Ycoord").value = "";
            document.getElementById("kanam").value = "10000";

            $('#targetsnewTitle').html('');
            $('#targetsnew').html('');
            $('#targetsoldTitle').html('');
            $('#targetsold').html('');

            /*document.getElementById("txtResX").value = "";
            document.getElementById("txtResY").value = "";*/
        }

        function ZoomToResult22() {
         

                var knm;
                var tmID2;
                if ($('#kanam').val() != "") {
                    knm = $('#kanam').val();
                } else {
                    knm = 20000;
                }
                if ($('#kanam').val())
                /*parent.parent.ZoomToView(Px, Py, $('#kanam').val(), true);
                    parent.parent.Refresh();*/


                    var to = 0;
                alert("PX" + Px + "\n Py" + Py + "\n kanam" + $('#kanam').val());
                parent.parent.ZoomToView(Px, Py, $('#kanam').val(), true);


                parent.parent.Refresh();
               


   


          
            /*parent.parent.mapFrame.RefreshMap();*/
}



function InitDocument() {
    
            dblKanam = parseFloat(document.getElementById("kanam").value);
          
            if (isNaN(dblKanam) ) {
                document.getElementById("kanam").value = 100000;
            }
            Ycoord.val( parent.parent.parent.Reqlon);
            Xcoord.val(parent.parent.parent.Reqlat);
            /*locationForm.LatInput.value = parent.parent.parent.Reqlat*/;
            if (Ycoord.val() == '' || Ycoord.val() == 'undefined') {
                Ycoord.val('');
                Xcoord.val('');
            } else {
              /*  locationForm.submit();*/

            }
        }

        function DigitizePoint() {
            
            //locationForm.LonInput.value = '';
            Ycoord.val('');
            Xcoord.val('');
            //locationForm.LatInput.value = '';
            parent.parent.mapFrame.DigitizePoint(OnPointDigitized);
        }
        function OnPointDigitized(point) {

           

            Px = parseFloat(point.X);
            Py = parseFloat(point.Y);
            $('#px1').val(Px);
            $('#py1').val(Py);
            Ycoord.val(parseFloat(point.X).toFixed(4));
            Xcoord.val(parseFloat(point.Y).toFixed(4));
           /* GetAjaxTest();*/
           /* locationForm.LonInput.value = point.X;
            locationForm.LatInput.value = point.Y;*/
        }
 
 function ddd() {

     parent.ZoomToView(Ycoord.val(), Xcoord.val(), dblKanam, true);
 }
    </script>
</head>

<body  dir="rtl" >

    <form id="locationForm"  runat="server">
    <input name="SESSION" type="hidden" value="<%= mgSessionId %>" />
    <input id="map" name="map" type="hidden" value="<%=mgMap%>" />
     <input id="px1" name="px1" type="hidden" runat="server"  />
      <input id="py1" name="py1" type="hidden" runat="server"  />
    <table border="0" cellspacing="0" cellpadding="0" width="100%" dir="rtl" style="height:28px">
      <tr><td class="clsHeaderLight">התמקדות לפי קואורדינאטות</td></tr>
      <tr><td class="clsHr" ></td></tr>
      
    </table>
    <table border="0" cellpadding="5" dir="rtl">
      <tr>
        <td class="clsFieldHeader" width="80px">סוג רשת :</td>
        <td align="right" class="MeasureData" >
            <select id=reshet dir=rtl style="width:130px">
                <!--<option value="1">רשת ישראל הישנה</option>-->
                <option value="2" selected>רשת ישראל החדשה</option>
               <!-- <option value="3">רשת UTM</option>
                <option value="4">רשת WGS84</option>-->
            </select>
        </td>
      </tr>
      <tr>
        <td class="clsFieldHeader">Y/Lat/North :</td>
        <td align="right" class="MeasureData">
            <!--<input id=Ycoord style="width:120px" dir=ltr />-->
           
             <input runat="server" maxlength="10" class="Ctrl" id="Xcoord" name="LatInput" style="width:120px" value="" />
        </td>
      </tr>
      <tr>
        <td class="clsFieldHeader">X/Lon/East:</td>
        <td align="right" class="MeasureData">
            <!--<input id=Xcoord style="width:120px" dir=ltr /> -->
             <input  runat="server" id="Ycoord" maxlength="10" class="Ctrl" name="LonInput" style="width:120px" value="" />
           
        </td>
      </tr>
      <tr>
        <td class="clsFieldHeader">קנה-מידה :</td>
        <td align="right" class="MeasureData" >
            <input id="kanam"  runat="server" name="kanam" style="width:100px" dir=ltr  />:1
        </td>
      </tr>
   <!--    <tr >
        <td colspan=2 class="clsFieldHeader">שמור מיקום : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type=checkbox id="SaveNaaz" value=0 /></td>
      </tr>-->
      <tr>
        <td colspan="2">
        
        <table>
        <tr>
          <td><input  class="clsLongButton"  id="Button1" type="button" value="בחר מהמפה" onclick="DigitizePoint()" /></td> 
        <td>  <input class="clsShortButton" type="button" value="נקה"  onclick="Clearall()" /></td>
        
        <td> <asp:Button ID="Button2" runat="server" Text="בצע" CssClass="clsShortButton" 
               onclick="Button2_Click" 
               ></asp:Button> </td>
        
  
  
           
   
        <!--<input class="clsShortButton" type="button" value="בצע" onclick="Zoom()" runat="server" on/>-->
       <!-- <td>   
         <script language="javascript"  type="text/javascript">
             /*if (ClearResults.MAP.value == "") {
                 try { ClearResults.MAP.value = locationForm.map.value; } catch (e) { }
             }*/
    function clearmap()
    {
   /*   parent.Refresh();*/
     this.location.href = "findlocationmain.aspx?SESSION=<%= mgSessionId %>&map=<%= mgMap %>";
      }

    </script>
       <form id="ClearResults" action="clearlocationresults.aspx" method="get" target="scriptFrame">
   <input type="hidden" name="SESSION" value="<%= mgSessionId %>" />
    <input type="hidden" name="map" value="<%=mgMap%>" />
    <input type="button" class="clsShortButton" value="נקה" onclick="clearmap()" />
   </form>*/
  
        <!--<input class="clsShortButton" type="button" value="סגור"  onclick="CloseForm()" style="width:60px"/></td>
        -->
       
        </tr>
      
        </table>
   
            
        <!--<input class="clsShortButton" type="button" value="התמקד"  onclick="Zoom()" />-->
            &nbsp;&nbsp;
         
            
        </td>
      </tr>

     <!-- <tr height=20px>
        <td colspan=2></td>
      </tr>
      <tr >
        <td colspan=2 class="clsHeaderLight">קואורדינאטות מותמרות</td>
      </tr>
      <tr>
        <td class="clsFieldHeader">קואורד' Y :</td>
        <td align="right" class="MeasureData">
            <input id=txtResY style="width:120px" dir=ltr />
        </td>
      </tr>
    
      <tr>
        <td class="clsFieldHeader">קואורד' X:</td>
        <td align="right" class="MeasureData">
            <input id=txtResX style="width:120px" dir=ltr />
        </td>
      </tr>
        -->
    </table> 
 
   
     <div id="targetsnewTitle" runat="server" class="clsFieldHeader"></div>
    <div id="targetsnew" runat="server" class="clsFieldHeader"></div>
    <div id="targetsoldTitle" runat="server" class="clsFieldHeader"></div>
    <div id="targetsold" runat="server" class="clsFieldHeader"></div>
     <div> <asp:Button ID="Button3" runat="server" Text="נקה הכל" 
                 CssClass="clsShortButton" onclick="Button3_Click" 
              
               ></asp:Button></div>
  <!--  <table dir="rtl" class="RegText" border="0" cellspacing="0" width="100%">
        <tr><td class="Title">&nbsp;איתור מיקום<hr></td></tr>
        <tr><td class="SubTitle">התמקד לנקודת ציון במפה</td></tr>
        <tr><td>מיקום:</td></tr>
  
        <tr><td><br /></td></tr>
        <tr><td><br />או הקלד באופן ידני</td></tr>
        <tr><td><br /><strong>Lat Lon</strong></td></tr>
        <tr>
            <td class="RegText">
                <!--X: <input maxlength="10" class="Ctrl" name="LonInput" style="width: 75%" value="" /><br/>
              <!--  Y: <input maxlength="10" class="Ctrl" name="LatInput" style="width: 75%" value="" />
		
            </td>
        </tr>
        <tr><td class="Title"><hr /></td></tr>
        <tr>
            <td>
           
            </td>
        </tr>
      
    </table>-->
    <div id="diverr" runat="server" class="clsFieldHeader"></div>
</form>



</body>
</html>
